﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Common.js" type="text/javascript"></script>
    <script type="text/javascript">

        function Test() {
            var str = "123321";
            //var reg = new RegExp("\\dabc", "gim");
            var reg = /^\d{6}$/; // 数字出现至少一次

            if (reg.test(str)) {
                Get("spa").innerHTML = "真";
            }
            else {
                Get("spa").innerHTML = "假";
            }

        }

        function Exec() {
            var str = "0531-66778899";
            var reg = /(\d{4})-(\d{7,8})/g;
            var r = reg.exec(str);
//            while((r = reg.exec(str)) != null) {
//                Get("spa").innerHTML += r + "<br/>";
//            }

        }


        BindEvent(window, "load", function (e) {
            //Test();
            Exec();

        });
    </script>
</head>
<body>
<span id="spa"></span>
</body>
</html>
